﻿function checkForm(form) {
    if (form.KeyWords.value == "") {
        alert("关键字不能为空!");
        return false;
    }
    if (form.ShopName.value == "") {
        alert("店铺名称不能为空!");
        return false;
    }
    if (form.ProductName.value == "") {
        alert("产品名称不能为空!");
        return false;
    }
    if (form.ShopName.value == "") {
        alert("店铺名称不能为空!");
        return false;
    }
    if (form.Url.value == "") {
        alert("连接网址不能为空!");
        return false;
    }
    if (form.Url.value == "") {
        alert("连接网址不能为空!");
        return false;
    }
//    if (form.ProductPicture.value == "") {
//        alert("图片不能为空!");
//        return false;
//    }
    if (form.ProductPrice.value == "")
        form.ProductPrice.value = "0";
    if (form.CommitCount.value == "")
        form.CommitCount.value = "0";
    if (form.Comment.value == "")
        form.Comment.value = "0";
    if (form.Shipping.value == "")
        form.Shipping.value = "0";
    var act = "RequestHandler.ashx" + document.location.search + "&t=pp";
    var index = document.location.search.indexOf("editshop");
    if (index != -1)
        act = "RequestHandler.ashx" + document.location.search.replace("editshop", "updateshop") + "&t=pp";
    form.action = act;
    form.submit();
}